package com.zllkj.mm.api.remote;

import com.github.gzuliyujiang.filepicker.adapter.FileEntity;
import com.zllkj.mm.api.network.BaseResponse;
import com.zllkj.mm.api.network.subscriber.BaseString;
import com.zllkj.mm.model.entity.DynamicCommentRecordVo;
import com.zllkj.mm.model.entity.DynamicCommentVo;
import com.zllkj.mm.model.entity.DynamicSubscriptionVo;
import com.zllkj.mm.model.entity.FileUrlEntity;
import com.zllkj.mm.model.entity.GoodsClassifyAllListS2;
import com.zllkj.mm.model.entity.GoodsSelfListS;
import com.zllkj.mm.model.entity.HomeShopListS;
import com.zllkj.mm.model.entity.LoginVo;
import com.zllkj.mm.model.entity.SelfShopInfoS;
import com.zllkj.mm.model.entity.UserDetailVo;
import com.zllkj.mm.model.entity.UserSelfVo;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import rx.Observable;

public interface Api {

    /**
     * 首页店铺列表
     */
    @POST("index/shopList")
    Observable<BaseResponse<HomeShopListS>> shopList(@Body Map<String, Object> map
    );


    /**
     * login/smsRegister
     * 短信注册
     */
    @POST("login/smsRegister")
    Observable<BaseResponse<LoginVo>> registerByPhone(@Body Map<String, Object> map
    );

    /**
     * login/smsRegister
     * 短信注册
     */
    @POST("user/getUserInfoById")
    Observable<BaseResponse<UserDetailVo>> getUserDetailById(@Body Map<String, Object> map);


    /**
     * sms/send
     * 发送短信
     */
    @POST("sms/send")
    Observable<BaseResponse<BaseString>> getTelCode(@Body Map<String, Object> map
    );

    /**
     * login/smsLogin
     * 短信登录
     */
    @POST("login/smsLogin")
    Observable<BaseResponse<LoginVo>> loginByCode(@Body Map<String, Object> map
    );

    /**
     * login/passwordLogin
     * 手机号码 + 密码登录
     */
    @POST("login/passwordLogin")
    Observable<BaseResponse<LoginVo>> login_pwd(@Body Map<String, Object> map
    );

    /**
     * login/firstSetPassword
     * 第一次设置密码
     */
    @POST("login/firstSetPassword")
    Observable<BaseResponse<LoginVo>> setPassword(@Body Map<String, Object> map, @Header("token") String s);



    /**
     * user/selfInfo
     * 个人信息
     */
    @POST("user/selfInfo")
    Observable<BaseResponse<UserSelfVo>> getInfo(@Body Map<String, Object> map
    );

    /**
     * user/selfInfo
     * 获取个人信息--用于"我的"
     */
    @POST("user/selfInfo")
    Observable<BaseResponse<UserSelfVo>> getUserInfo(@Body Map<String, Object> map
    );


    /**
     * file/getBaseUrlao
     * 获取文件拼接地址
     */
    @POST("file/getBaseUrl")
    Observable<BaseResponse<BaseString>> fileGetBaseUrl(@Body Map<String, Object> map);


    /**
     * user/edit
     * 用户编辑自己信息
     */
    @POST("user/edit")
    Observable<BaseResponse<UserSelfVo>> userEdit(@Body Map<String, Object> map
    );


    /**
     * user/edit
     * upload file
     */
    @Multipart
    @POST("file/uploadFile")

    Observable<BaseResponse<FileUrlEntity>> uploadImage(@Part MultipartBody.Part file, @Part("file") RequestBody description);

    @Multipart
    @POST("file/uploadFile")

    Observable<BaseResponse<FileUrlEntity>> uploadVideo(@Part MultipartBody.Part file, @Part("file") RequestBody description);



    /**
     * shopApply/apply
     * 开店申请
     */
    @POST("shopApply/apply")
    Observable<BaseResponse<BaseString>> shopApply(@Body Map<String, Object> map
    );

    /**
     * shop/selfInfo
     * 个人店铺详情
     */
    @POST("shop/selfInfo")
    Observable<BaseResponse<SelfShopInfoS>> shopSelfInfo(@Body Map<String, Object> map
    );

    /**
     * goods/selfList
     * 用户自己店铺商品列表
     */
    @POST("goods/selfList")
    Observable<BaseResponse<GoodsSelfListS>> goodsSelfList(@Body Map<String, Object> map
    );

    /**
     * goods/add
     * 添加商品
     */
    @POST("goods/add")
    Observable<BaseResponse<BaseString>> goodsAdd(@Body Map<String, Object> map
    );

    /**
     * goodsClassify/allList
     * 全部商品分类列表
     */
    @POST("goodsClassify/AllList")
    Observable<BaseResponse<GoodsClassifyAllListS2>> goodsClassifyAllList2(@Body Map<String, Object> map
    );

    /**
     * goods/del
     * 删除商品
     */
    @POST("goods/del")
    Observable<BaseResponse<BaseString>> goodsDel(@Body Map<String, Object> map
    );

    /**
     * goods/offShelf
     * 下架商品
     */
    @POST("goods/offShelf")
    Observable<BaseResponse<BaseString>> goodsOffShelf(@Body Map<String, Object> map
    );

    /**
     * goods/onShelf
     * 上架商品
     */
    @POST("goods/onShelf")
    Observable<BaseResponse<BaseString>> goodsOnShelf(@Body Map<String, Object> map
    );

    /**
     * goods/top
     * 置顶商品
     */
    @POST("goods/top")
    Observable<BaseResponse<BaseString>> goodsTop(@Body Map<String, Object> map
    );

    /**
     * 获取广场-关注动态列表
     */
    @POST("dynamic/focusList")
    Observable<BaseResponse<DynamicSubscriptionVo>> dynamicSubscriptionList(@Body Map<String, Object> map
    );

    /**
     * 获取广场-关注动态列表
     */
    @POST("dynamic/nearbyList")
    Observable<BaseResponse<DynamicSubscriptionVo>> dynamicNearbyList(@Body Map<String, Object> map
    );

    /**
     * 获取广场- 评论列表
     */
    @POST("dynamicComment/list")
    Observable<BaseResponse<DynamicCommentVo>> dynamicCommentList(@Body Map<String, Object> map);

    /**
     * 评论
     * @param map
     * @return
     */
    @POST("dynamicComment/sonList")
    Observable<BaseResponse<DynamicSubscriptionVo>> dynamicSubCommentList(@Body Map<String, Object> map);

    @POST("dynamic/release")
    Observable<BaseResponse<DynamicSubscriptionVo>> addPost(@Body Map<String, Object> map);

    @POST("dynamic/like")
    Observable<BaseResponse<DynamicSubscriptionVo>> LikePost(@Body Map<String, Object> map);




    /*f
    addSubscribe(RetrofitHelper.getInstance().getApi()
                            .getChatUserInfo(L.sign(new HashMap() {{
                                put("phone", etPhone.getText().toString());
                                put("password", etPwd.getText().toString());
                            }}))
                            .compose(RxHelper.<BaseString>defaultHandleResult())
                            .subscribe(new BaseRxSubscriber<BaseString>() {
                                @Override
                                protected void onSucc(BaseString o) {

                                }
                            })
                    );
     addSubscribe(RetrofitHelper.getInstance().getApi()
                            .getChatUserInfo(L.sign(new HashMap() {{
                                put("phone", etPhone.getText().toString());
                                put("password", etPwd.getText().toString());
                            }}))
                            .compose(RxHelper.<BaseString>defaultHandleResult())
                            .subscribe(new ProgressSubscriber<BaseString>(getContext()) {
                                @Override
                                protected void onSucc(BaseString o) {

                                }
                            })
                    );
    */

}
